<template>    
<!-- 弹出层 -->
      <div class="md-modal md-effect-1" id="modal-1" >
        <div class="md-content">
            <div class="modal-header h5-list-title">流程审批</div>
            <div style="text-align: center;">
            	<input type="radio" value="0" name="checkStatus" v-model="checkStatus"/> 通过
            	<input type="radio" value="1" name="checkStatus" v-model="checkStatus"/> 驳回
            	
            </div>
            <div class="modal-body content">
                <div class="input border-top-bottom-default">
                    <textarea placeholder="请输入原因" v-model="message"></textarea>
                </div>
            </div>
            <div class="modal-footer">
                <span class="modal-btn md-close">再想想</span>
                <span class="modal-btn md-submit" v-on:click="submitAct()">确定</span>
            </div>
        </div>
    </div>
</template>
<script type="text/javascript">
	export default{
		props: ['taskId','userId'],
		data(){
			return{
				checkStatus:'',
				message:''
			}
		},
		methods:{
			submitAct:function(){
				var _self = this;
				var taskId = _self.taskId;
				var userId = _self.userId;
				var checkStatus = _self.checkStatus;
				var message = _self.message;
				
				if(checkStatus==""||checkStatus==null){
					layer.alert("请选择审核状态!");
					return false;
				}
				if(message==null||message==""){
					layer.alert("请填写审核信息!");
					return false;
				}
				var index = layer.load(0, {shade: false});
				var url = _self.utilHelper.apiUrl+'/wordFlowData/processCheck';		
				var params = {
					taskId:taskId,
					checkStatus:checkStatus,
					message:message,
					userId:userId
				};
				_self.$http.post(url,params).then((response)=>{
					var body = response.body;
					if(body.res=="1"){
						layer.closeAll('loading');
						layer.confirm(body.obj, {
							  btn: ['退出']
							}, function(){
							   WeixinJSBridge.call('closeWindow');
							});
						
					}else{
						layer.closeAll('loading');
							layer.confirm(body.resMsg, {
							  btn: ['退出']
							}, function(){
							   WeixinJSBridge.call('closeWindow');
							});
					}
				});
			}
		}
	}
	
</script>


